<nz-card>
  <div class="mb-md">
    <label> 检验模板编号
      <input nz-input [(ngModel)]="this.searchBeans[0].attributeValue" name="code" style="width: 150px;"
             class="mr-sm" />
    </label>

    <label> 模板状态
      <nz-select nzShowSearch nzAllowClear nzPlaceHolder="Select a status" style="width: 150px" [(ngModel)]="this.searchBeans[1].attributeValue">
        <nz-option nzLabel="全部" nzValue=""></nz-option>
        <nz-option nzLabel="启用" nzValue="1"></nz-option>
        <nz-option nzLabel="禁用" nzValue="0"></nz-option>
      </nz-select>
    </label>

    <button nz-button (click)="this.loadListData()" [nzType]="'primary'" style="margin-left: 15px">搜索</button>
    <button nz-button (click)="this.clearParam(); this.loadListData()">重置</button>

  </div>

  <nz-divider [nzDashed]=true  style="margin: 0;padding: 0"></nz-divider>

  <div style="padding: 10px;">
    <button nz-button (click)="open()" [nzType]="'primary'">新增</button>
    <button nz-button nz-popconfirm
            nzPopconfirmTitle="确认删除选中吗?"
            nzPopconfirmPlacement="right"
            (nzOnConfirm)="delete()"
            (nzOnCancel)="cancel()">删除
    </button>
  </div>


  <nz-table #basicTable [nzData]="dataList" [nzLoading]="loading" nzBordered nzSize="small">
    <thead>
    <tr>
      <th>检验模板编号</th>
      <th>检验模板名称</th>
      <th>检验模板描述</th>
      <th>是否启用</th>
      <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <tr *ngFor="let data of basicTable.data">
      <td>{{data.code}}</td>
      <td>{{data.name}}</td>
      <td>{{data.description}}</td>
      <td>
        <nz-tag nzColor="{{data.enable === 1 ? 'success' : 'error'}}">{{data.enable === 1 ? '启用' : '禁用'}}</nz-tag>
      </td>
      <td>
        <a nz-button nzType="link" (click)="edit(data)"><i nz-icon nzType="edit"></i>编辑</a>
        <a nz-button nzType="link" (click)="openEditItem(data)"><i nz-icon nzType="edit"></i>检验项</a>
        <a nz-button nzType="link" (click)="delete(data.id)"><i nz-icon nzType="delete"></i>删除</a>
      </td>
    </tr>
    </tbody>
  </nz-table>
</nz-card>

<app-device-inspection-template-edit #deviceInspectionTemplateEditComponent
                                     (voted)="onSmt()"></app-device-inspection-template-edit>

<app-device-inspection-template-item-edit #deviceInspectionTemplateItemEditComponent
                                          (voted)="onSmt()"></app-device-inspection-template-item-edit>
